package com.hushan.elevator.controller;

import com.hushan.elevator.model.Department;
import com.hushan.elevator.model.User;
import com.hushan.elevator.security.SecurityUtils;
import com.hushan.elevator.service.RoleService;
import com.hushan.elevator.utils.Result;
import com.hushan.elevator.utils.ResultCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RequestMapping("/role")
@RestController
@Tag(name = "roleController", description = "角色")
public class RoleController {
    private final RoleService  roleService;

    public RoleController(RoleService roleService) {
        this.roleService = roleService;
    }

    @Operation(summary = "获取所有角色", description = "返回全部角色")
    @GetMapping
    public Result getAllDept() {
        return new Result(ResultCode.SUCCESS, roleService.findAllRoles());
    }
}
